package com.elvende.web.client.presenter;

import com.elvende.web.client.display.ModuleDisplay;
import com.elvende.web.client.service.LifeServiceAsync;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.ui.HasWidgets;
public class LifePresenter implements Presenter {
	 private final LifeServiceAsync rpcService;
	  private final HandlerManager eventBus;
	  private final Display display;
	
	 public LifePresenter(LifeServiceAsync rpcService, HandlerManager eventBus, Display view) {
		    this.rpcService = rpcService;
		    this.eventBus = eventBus;
		    this.display = view;
	 }
	 
	public interface Display extends ModuleDisplay{	
		HasClickHandlers getList();
	}

	public void bind() {		
	}
	
   private void fetchAffortableHousing() {
//	   rpcService.listAffortableHousing(new AsyncCallback<AffortableHousing[]>(){
//		   public void onSuccess(AffortableHousing[] result) {	
//			   display.setAffortableHousing(result);
//		   }
//		   public void onFailure(Throwable caught) {			   
//		   }
//	   });	   
   }

	
	public void go(HasWidgets container) {
	    bind();
	    container.clear();
	    container.add(display.asWidget());
	}
}
